<form id="fm_parameter_update" class="form-horizontal" action="__APP__/System/parameters_update" method="post">
<div class="tabbable">
  <ul class="nav nav-tabs">
    <li class="active"><a href="#1" data-toggle="tab"><span class="icon12 cc-icon-settings"></span>基本设置</a></li>
    <li><a href="#2" data-toggle="tab"><span class="icon12 cc-icon-database"></span>数据库配置</a></li>
    <li><a href="#3" data-toggle="tab"><span class="icon12 cc-icon-bug"></span>控制中心配置</a></li>
  </ul>
  <div class="tab-content">
    <div class="tab-pane active" id="1">

                      <fieldset>
                        <legend>基本资料</legend>
                        <div class="control-group">
                          <label class="control-label" for="web_name">系统名称及版本号</label>
                          <div class="controls">
                              <input type="text" class="input-xlarge" id="web_name" name="web_name" value="<php>echo C('WEB_NAME')</php>">
                              <input type="text" class="input-small" id="web_version" name="web_version" value="<php>echo C('WEB_VERSION')</php>">
                          </div>

                        </div>
                                              
                        <div class="control-group">
                          <label class="control-label" for="page_size">分页大小</label>
                          <div class="controls">
                            <input id="page_size" name="page_size"  value="<php>echo C('PAGE_SIZE')</php>">
                            
                          </div>
                        </div>
                        
                        <div class="control-group">
                          <label class="control-label" for="chart_limit">图表显示最大记录数</label>
                          <div class="controls">
                            <input id="chart_limit" name="chart_limit" value="<php>echo C('CHART_LIMIT')</php>">
                          </div>
                        </div>
                        
                        
                        
                        <legend>模板布局</legend>
                        <div class="control-group">
                          <label class="control-label" for="default_theme">模板主题</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="default_theme"  name="default_theme"  value="<php>echo C('DEFAULT_THEME')</php>">
                          </div>
                        </div>
                        
                        
                        <div class="control-group">
                          <label class="control-label" for="layout_on">模板开关</label>
                          <div class="controls">
                            <div class="normal-toggle-button">
                                <input id="layout_on" name="layout_on" type="checkbox" <php> if (C('LAYOUT_ON')==1) echo 'checked="checked"' </php> class="nostyle">
                            </div>
                          </div>
                        </div>
                        
                        <div class="control-group">
                          <label class="control-label" for="layout_name">模板名称</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="layout_name" name="layout_name" value="<php>echo C('LAYOUT_NAME')</php>">
                          </div>
                        </div>
                        <legend>目录配置</legend>
                        <div class="control-group">
                          <label class="control-label" for="upload_path">文件上传目录</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="upload_path" name="upload_path" value="<php>echo C('UPLOAD_PATH')</php>">
                          </div>
                        </div>
                        
                        <div class="control-group">
                          <label class="control-label" for="version_path">运维程序发布目录</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="version_path"  name="version_path" value="<php>echo C('VERSION_PATH')</php>">
                          </div>
                        </div>
                        
                        
                      </fieldset>                
            
    </div>
    <div class="tab-pane" id="2">

                      <fieldset>
                        <legend>配置信息</legend>
                        <div class="control-group">
                          <label class="control-label" for="db_type">数据库类型</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="db_type" name="db_type" value="<php>echo C('DB_TYPE')</php>">
                          </div>

                        </div>
                          
                        <div class="control-group">
                          <label class="control-label" for="db_host">主机</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="db_host" name="db_host" value="<php>echo C('DB_HOST')</php>">
                          </div>

                        </div>
                          
                        <div class="control-group">
                          <label class="control-label" for="db_name">数据库名称</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="db_name" name="db_name" value="<php>echo C('DB_NAME')</php>">
                          </div>

                        </div>
                          
                          <div class="control-group">
                          <label class="control-label" for="db_user">用户名</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="db_user"  name="db_user" value="<php>echo C('DB_USER')</php>">
                          </div>

                        </div>
                        <div class="control-group">
                          <label class="control-label" for="db_pwd">密码</label>
                          <div class="controls">
                              <input type="password" class="input-xlarge" id="db_pwd"  name="db_pwd" value="<php>echo C('DB_PWD')</php>">
                          </div>

                        </div>
                          
                        <div class="control-group">
                          <label class="control-label" for="db_port">端口</label>
                          <div class="controls">
                            <input  class="input-small" id="db_port" name="db_port"  value="<php>echo C('DB_PORT')</php>">
                          </div>

                        </div>
                          
                         <div class="control-group">
                          <label class="control-label" for="db_prefix">表前缀</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="db_prefix"  name="db_prefix" value="<php>echo C('DB_PREFIX')</php>">
                          </div>

                        </div>
                          
                      </fieldset>
             
    </div>
    <div class="tab-pane" id="3">
        <fieldset>
                        <legend>基本资料</legend>
                        <div class="control-group">
                          <label class="control-label" for="ctrlcenter">控制中心地址</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="ctrlcenter" name="ctrlcenter" value="<php>echo C('CtrlCenter')</php>">
                          </div>

                        </div>
                          
                        <div class="control-group">
                          <label class="control-label" for="productid">产品编号及名称</label>
                          <div class="controls">
                            <input type="text" class="input-small" id="productid" name="productid" value="{$product.productid}">
                            <input type="text" class="input-xlarge" id="productname" name="productname" value="{$product.productname}">
                          </div>
                        </div>
                        <legend>控制中心数据库</legend>  
                        <div class="control-group">
                          <label class="control-label" for="cent_db_name">数据库地址</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="cent_db_host"  name="cent_db_host" value="{$cent_db['DB_HOST']}">
                          </div>

                        </div>
                        <div class="control-group">
                          <label class="control-label" for="cent_db_name">数据库名称</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="cent_db_name" name="cent_db_name" value="{$cent_db['DB_NAME']}">
                          </div>

                        </div>
                          
                          <div class="control-group">
                          <label class="control-label" for="cent_db_user">用户名</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="cent_db_user" name="cent_db_user" value="{$cent_db['DB_USER']}">
                          </div>

                        </div>
                        <div class="control-group">
                          <label class="control-label" for="cent_db_pwd">密码</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="cent_db_pwd" name="cent_db_pwd" value="{$cent_db['DB_PWD']}">
                          </div>

                        </div>
                          
                        <div class="control-group">
                          <label class="control-label" for="cent_db_port">端口</label>
                          <div class="controls">
                            <input id="cent_db_port" name="cent_db_port" value="{$cent_db['DB_PORT']}">
                          </div>

                        </div>
                          
                         <div class="control-group">
                          <label class="control-label" for="cent_db_prefix">表前缀</label>
                          <div class="controls">
                            <input type="text" class="input-xlarge" id="cent_db_prefix" name="cent_db_prefix" value="{$cent_db['DB_PREFIX']}">
                          </div>

                        </div>
                        
                       
                          
                      </fieldset>

    </div>
  </div>
    <div class="form-actions">
        <button type="submit" class="btn btn-primary">保存更改</button>
        <button type="reset" class="btn">取消</button>
      </div>
    
</div>
</form>

<script type="text/javascript">
     $(function(){
        //$("input, textarea, select").not(".nostyle").uniform();
        //$('.normal-toggle-button').toggleButtons();
        
        $("#fm_parameter_update").validate({
            rules: {
                    web_name : "required",
                    web_version: "required",
                    page_size : {digits:true},
                    chart_limit:{digits:true}
            },
            messages: {
                    web_name : "请输入版本号!",
                    web_version:"请选择发布文件",
                    page_size:"请输入数值!",
                    chart_limit:"请输入数值!"

            }
        });
        
        
        $( "#page_size" ).spinner();
        $( "#chart_limit").spinner();
        
        $( "#db_port").spinner();
        $( "#cent_db_port").spinner();
        
        /*
        $('a[data-toggle="tab"]').on('shown', function (e) {
            e.target // activated tab
            e.relatedTarget // previous tab
            var target = String(e.target);
            var index = target.indexOf("#");
            $.cookie("paramenter_current",target.substr(index+1));
          })
          
          $('.tabbable>ul>li').each(function(n,e){
              var paramenter_current = $.cookie("paramenter_current");
              if (paramenter_current == n+1){
                  $(e).attr('class','active');
                  
                  $(e).find('a').click();
              }
              else{
                  $(e).attr('class','');
              }
          });
    
          */
     });
        
</script>
